home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-11-15 | 1.7 KB | 36 lines | [TEXT/CWIE] |
- This is for PowerPC only, and the assembly code at the end is PowerPC
- assembly. The MathLib library is a PowerPC only library.
-
- This code has been tested with Metrowerks Codewarrior 10 and produces
- the same result as standard code compiled with Mr. C (with the 128 bit
- long double option turned on).
-
- This code is needed to call the MathLib functions because the current
- Metrowerks compilers do not create a 128 bit long double, they create
- a 64 bit long double. All of the MathLib functions that require a long
- double expect a 128 bit long double and therefore do not produce the
- correct results when given a 64 bit long double.
-
- The callMathLib1ArgFcn routine takes three pointers, two pointers to
- long_doubles and one ProcPtr. The first pointer to a long_double is
- the argument, the second pointer to a long_double is the result, and
- the ProcPtr is the MathLib function to be called.
-
- The callMathLib2ArgFcn routine takes four pointers, three pointers to
- long_doubles and one ProcPtr. The first two pointers to long_double's
- are the first two arguments to the function to be called, the third pointer
- to a long_double is the result returned by the function to be called, and
- the ProcPtr is the MathLib function to be called (in this example the powl
- function).
-
- The callMathLibXArgFcn functions set up the floating point registers,
- call the MathLib function, and then return the results in the result
- structure.
-
- The callMathLibFcn can easily be modified to deal with other functions
- which don't take only long doubles or return something other than a
- long double, but that is left up to the reader.
-
- There are only 5 out of 46 functions in fp.h that these two routines
- don't cover.
-